<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">

		<title>评价管理</title>

		<link href="../AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css">
		<link href="../AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css">
		<!--  -->
		<link href="../css/personal.css" rel="stylesheet" type="text/css">
		<link href="../css/cmstyle.css" rel="stylesheet" type="text/css">
		
		<script type="text/javascript" src="../js/vue2.5.js" ></script>
		<script type="text/javascript" src="../js/axios.min.js" ></script>
		<script type="text/javascript" src="../js/jquery-1.11.2.min.js" ></script>
		<script type="text/javascript" src="../js/global.js" ></script>
		<script type="text/javascript" src="../js/bootstrap/js/bootstrap.js" ></script>
		<script type="text/javascript" src="../js/layer/layer.js" ></script>
		<script src="../js/param.js"></script>
		<script src="../AmazeUI-2.4.2/assets/js/jquery.min.js"></script>
		<script src="../AmazeUI-2.4.2/assets/js/amazeui.js"></script>
		<link rel="stylesheet" type="text/css" href="../js/bootstrap/css/bootstrap.css" />
		<style>
			.item-basic-info{
				width:100px;
			}
			.info-little span{
				position:fixed;
				margin-left: -140px;
				z-index: 999;
			}
		</style>
	</head>
	
	<body>
		
		<div class="nav-table">
			<div class="long-title"><span class="all-goods">全部分类</span></div>
			<div class="nav-cont">
				<ul>
							<li class="index"><a href="../index.html">首页</a></li>
							<li class="qc"><a href="text.html">推荐</a></li>
							<li class="qc"><a href="../home/search.html">搜索</a></li>
							<li class="qc"><a href="#">团购</a></li>
							<li class="qc last"><a href="about.html">我们</a></li>
						</ul>
			</div>
		</div>
		<b class="line"></b>
		<div class="center">
			<div class="col-main">
				<div class="main-wrap">

					<div class="user-comment container">
						<!--标题 -->
						<div class="am-cf am-padding">
							<div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">评价管理</strong> / <small>Manage&nbsp;Comment</small></div>
						</div>
						<hr/>

						<div class="am-tabs am-tabs-d2 am-margin" data-am-tabs>

							<ul class="am-avg-sm-2 am-tabs-nav am-nav am-nav-tabs">
								<li class="am-active"><a href="#tab1">所有评价</a></li>
							</ul>

							<div class="am-tabs-bd">
								<div class="am-tab-panel am-fade am-in am-active" id="tab1">

									<div class="comment-main">
										<div class="comment-list" >
										<ul class="item-list" v-for="(comment,index) in commentData" style="display:block; margin-bottom:20px;">
											<div class="comment-top">
												<div class="th th-price">
													<td class="td-inner">评价</td>
												</div>
												<div class="th th-item">
													<td class="td-inner">商品</td>
												</div>													
											</div>
										
												<li class="td td-item">
													<div class="item-pic">
														<a href="#" class="J_MakePoint">
															<img :src="baseUrl+'/goods/getgoods?gid='+ comment.goods.gid" class="itempic" >
														</a>
													</div>
												</li>

												<li class="td td-comment">
													<div class="item-title">
														<div class="item-opinion">好评</div>
														<div class="item-name">
															<a href="#">
																<p class="item-basic-info">{{comment.goods.gname}}</p>
															</a>
														</div>
													</div>
													<div class="item-comment">
														{{comment.satisfaction}}||{{comment.content}}
													</div>

													<div class="item-info">
														<div>
															<p class="info-little"><span>描述：{{comment.goods.gdesc}}</span> </p>
															<p class="info-time">{{comment.date}} || <span @click="remove(comment.cmid)" style="cursor: pointer;"> 删除</span></p>

														</div>
													</div>
												</li>

											</ul>

										</div>
									</div>
									<!--分页工具条-->
									<!--分页工具条-->
			<div id="row">
				<div class="col-sm-2">
					<div class="pageInfo">
						共{{pager.recordCount}}条数据{{pager.pageNum}}/{{pager.pageCount}}页
					</div>
				</div>
				<nav class="col-sm-8">
					<nav id="pageNav">
						<ul class="pagination pagination-sm pull-right">
							<li><a href="javascript:;" id="firstPage" @click="query(1)" v-show="pager.pageNum!=1">首页</a></li>
							<li><a href="javascript:;" id="prevPage" @click="query(pager.pageNum-1)" v-show="pager.pageNum!=1">上一页</a></li>
							<li :class="{active:pager.pageNum==i}" v-for="i in pageBtns"> <a href="javascript:;" @click="query(i)">{{i}}</a></li>
							<li><a href="javascript:;" id="nextPage" @click="query(pager.pageNum+1)" v-show="pager.pageNum!=pager.pageCount">下一页</a></li>
							<li><a href="javascript:;" id="lastPage" @click="query(pager.pageCount)" v-show="pager.pageNum!=pager.pageCount">末页</a></li>
						</ul>
					</nav>
				</nav>	
			</div>
								</div>
								
							</div>
						</div>

					</div>

				</div>
				<!--底部-->
				<div class="footer">
					<div class="footer-hd">
						<p>
							
							<b>|</b>
							<a href="#">商城首页</a>
							<b>|</b>
							<a href="#">支付宝</a>
							<b>|</b>
							<a href="#">物流</a>
						</p>
					</div>
					<div class="footer-bd">
						<p>
							
							<a href="#">合作伙伴</a>
							<a href="#">联系我们</a>
							<a href="#">网站地图</a>
							<em>© 2015-2025 Hengwang.com 版权所有. 更多模板 <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> - Collect from <a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a></em>
						</p>
					</div>
				</div>
			</div>

	<aside class="menu">
				<ul>
					<li class="person active">
						<a href="person/index.html"><i class="am-icon-user"></i>个人中心</a>
					</li>
					<!--管理员界面-->
					<li class="person">
						<p><i class="am-icon-qq"></i>管理系统</p>
						<ul>
							<li> <a href="querygoods.html">商品管理</a></li>
							<li> <a href="queryorder.html">订单管理</a></li>		
							
						</ul>
					</li>
					<!--普通界面-->
					<li class="person">
						<p><i class="am-icon-newspaper-o"></i>个人资料</p>
						<ul>
							<li> <a href="information.html">个人信息</a></li>
							<li> <a href="safety.html">安全设置</a></li>
							<li> <a href="address.html">地址管理</a></li>
							
						</ul>
					</li>
					<li class="person">
						<p><i class="am-icon-balance-scale"></i>我的交易</p>
						<ul>
							<li><a href="order.html">订单管理</a></li>
							<li> <a href="change.html">退款售后</a></li>
							<li> <a href="comment.html">评价商品</a></li>
						</ul>
					</li>
					
					<li class="person">
						<p><i class="am-icon-tags"></i>我的收藏</p>
						<ul>
							<li> <a href="collection.html">收藏</a></li>
															
						</ul>
					</li>
					<li class="person">
						<p><i class="am-icon-qrcode"></i>在线客服</p>
						<ul>
							<li> <a href="suggest.html">意见反馈</a></li>		
							<li> <a href="news.html">我的消息</a></li>
						</ul>
					</li>
					
				</ul>

			</aside>
		</div>
	
	</body>
			<script>
		
		var uid = localStorage.getItem('id');
		
			var vue = new Vue({
				el:'.container',
				data:{
					goods:{},
					commentData:[],
					baseUrl:baseUrl,
					pager: {}, //分页数据
					pageBtns: []//分页按钮数组
				},
				methods:{
					
					query:function(pageNum){
						axios.get(baseUrl + '/comment/queryByuid',{
							params:{
								uid:uid,
								pageNum: pageNum,
								pageSize: 4
							}
						})
							.then(function(response) {
								
								this.commentData = response.data.list;
								this.pager = response.data.pager;
								//生成分页页码按钮
								var start = this.pager.pageNum - 2;
								var end = this.pager.pageNum + 2;

								if (this.pager.pageNum <= 3) {
									start = 1;
									end = 5;
								}
								if (end > this.pager.pageCount)
									end = this.pager.pageCount;
								this.pageBtns = [];

								for (var i = start; i <= end; i++) {
									this.pageBtns.push(i);
								}
								
							}.bind(this))
							.catch(function(error) {
								layer.msg('请求失败');
							});
						
					} ,//删除记录
					remove: function(cmid,index) {
						if(!window.confirm('确定移除吗？'))
							return;
						axios.get(baseUrl + '/comment/delete',{
							params:{
								cmid:cmid
							}
						})
							.then(function(response) {
									
								this.commentData.splice(index, 1);
								layer.msg('删除记录成功！');
							}.bind(this))
							.catch(function(error) {
								layer.msg('请求失败');
							});
					} 
			
					
					
				},
				mounted:function(){
					
					this.query(1);
					
				}				
			});		
				
		</script>
</html>